package com.aihna.mall.mapper;

import com.aihna.mall.domain.StoreProduct;
import com.aihna.mall.domain.vo.StoreProductVo;
import com.aihna.common.mybatis.core.mapper.BaseMapperPlus;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;

/**
 * 商品Mapper接口
 *
 * @author Joseph.Chen
 * @date 2024-03-29
 */
public interface StoreProductMapper extends BaseMapperPlus<StoreProduct, StoreProductVo> {
    default Long selectCount() {
        LambdaQueryWrapper<StoreProduct> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.le(StoreProduct::getStock, 10);
        queryWrapper.eq(StoreProduct::getIsRecycle,0);
        queryWrapper.eq(StoreProduct::getDelFlag,0);
        return selectCount(queryWrapper);
    }
}
